import Vue from "vue";
import App from "./App.vue";
import store from "./store/store";

// 初始化
import "./assets/css/reset.css";

// http
import Http from "./server/index";
Vue.prototype.$http = Http;

// 注册datav组件为全局组件
import {
  fullScreenContainer,
  borderBox1,
  borderBox2,
  borderBox3,
  borderBox4,
  borderBox5,
  borderBox6,
  borderBox7,
  borderBox8,
  borderBox9,
  borderBox10,
  borderBox11,
  borderBox12,
  borderBox13,
  decoration1,
  decoration2,
  decoration3,
  decoration4,
  decoration5,
  decoration6,
  decoration7,
  decoration8,
  decoration9,
  decoration10,
  decoration11,
  decoration12,
  loading,
  digitalFlop,
  scrollBoard
} from "@jiaminghi/data-view";
Vue.use(fullScreenContainer);
Vue.use(borderBox1);
Vue.use(borderBox2);
Vue.use(borderBox3);
Vue.use(borderBox4);
Vue.use(borderBox5);
Vue.use(borderBox6);
Vue.use(borderBox7);
Vue.use(borderBox8);
Vue.use(borderBox9);
Vue.use(borderBox10);
Vue.use(borderBox11);
Vue.use(borderBox12);
Vue.use(borderBox13);
Vue.use(decoration1);
Vue.use(decoration2);
Vue.use(decoration3);
Vue.use(decoration4);
Vue.use(decoration5);
Vue.use(decoration6);
Vue.use(decoration7);
Vue.use(decoration8);
Vue.use(decoration9);
Vue.use(decoration10);
Vue.use(decoration11);
Vue.use(decoration12);
Vue.use(loading);
Vue.use(digitalFlop);
Vue.use(scrollBoard);

// 引入animate.css
import animated from "animate.css";

// element ui
import "element-ui/lib/theme-chalk/index.css";
// import ElementUI from "element-ui";
// Vue.use(ElementUI);
// 改为按需引入
import {
  Pagination,
  Badge,
  Dropdown,
  DropdownMenu,
  DropdownItem,
  Table,
  TableColumn,
  Autocomplete,
  Radio,
  RadioGroup,
  RadioButton,
  Checkbox,
  CheckboxButton,
  CheckboxGroup,
  Button,
  Input,
  Message,
  Notification,
  Dialog,
  MessageBox,
  Select,
  Option,
  Popover,
  Slider,
  Loading,
} from "element-ui";

Vue.use(Pagination);
Vue.use(Badge);
Vue.use(Dropdown);
Vue.use(DropdownMenu);
Vue.use(DropdownItem);
Vue.use(Table);
Vue.use(TableColumn);
Vue.use(Autocomplete);
Vue.use(Radio);
Vue.use(RadioGroup);
Vue.use(RadioButton);
Vue.use(Checkbox);
Vue.use(CheckboxButton);
Vue.use(CheckboxGroup);
Vue.use(Button);
Vue.use(Input);
Vue.use(Dialog)
Vue.use(Select)
Vue.use(Option)
Vue.use(Popover)
Vue.use(Slider)
Vue.use(Loading.directive)

Vue.prototype.$loading = Loading.service
Vue.prototype.$message = Message
Vue.prototype.$notify = Notification
Vue.prototype.$msgbox = MessageBox
Vue.prototype.$alert = MessageBox.alert
Vue.prototype.$confirm = MessageBox.confirm
Vue.prototype.$prompt = MessageBox.prompt

// 引入echarts
// import echarts from "echarts";
// Vue.prototype.$echarts = echarts;
//引入基本模板
let echarts = require('echarts/lib/echarts')
// 引入折线图等组件
require('echarts/lib/chart/line')
require('echarts/lib/chart/bar')
require('echarts/lib/chart/pie')
require('echarts/lib/chart/map')
require('echarts/lib/chart/effectScatter')
require('echarts/lib/component/geo')

// 引入提示框和title组件，图例
require('echarts/lib/component/tooltip')
require('echarts/lib/component/title')
require('echarts/lib/component/legend')
require('echarts/lib/component/legendScroll')//图例翻译滚动

Vue.prototype.$echarts = echarts

// 百度地图
import BaiduMap from 'vue-baidu-map'
Vue.use(BaiduMap, {
  // ak 是在百度地图开发者平台申请的密钥 
  ak: 'yIOpoZXO6mAbXCG5f873kcEVoTsdh25h'
})

// 路由
import router from "./route/router";

// 返回组件
import GoBack from "./components/widget/GoBack.vue";
Vue.component("GoBack", GoBack);
import GoIndex from "./components/widget/GoIndex.vue";
Vue.component("GoIndex", GoIndex);

// config
import config from "./utils/config";
Vue.prototype.$config = config;

// 全局前进后退 [预留 ---------------------------------------------]
Vue.prototype.$transitionName = "slide-push";
Vue.prototype.push = (url) => {
  //前进
  Vue.prototype.$transitionName = "slide-push";
  this.$router.push(url);
};

Vue.prototype.pop = (n = -1) => {
  //后退
  Vue.prototype.$transitionName = "slide-pop";

  let path = this.$router.currentRoute.path;
  if (path == "/") {
    return;
  }
  this.$router.go(n);
};
// [预留 end ---------------------------------------------]

Vue.config.productionTip = false;

Vue.use(animated);

//
new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");
